package com.pubinfo.passbook.common.model.eop;

import com.pubinfo.passbook.common.utils.MD5;
import com.pubinfo.passbook.common.utils.TimeUtils;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;

import java.util.Date;

@Data
public class ApplyInvoiceHeadParam {

    @ApiModelProperty("渠道编码(由统一平台提供)")
    private String channel;

    @ApiModelProperty("渠道秘钥+ channel +年月日（20160101）做MD5（32位大写）加密")
    private String channel_token;

    @ApiModelProperty("预检验/下单")
    private String service_code;

    public ApplyInvoiceHeadParam(String channel, String privateKey, String  service_code) {
        super();
        this.channel = channel;
        this.channel_token = MD5.digest(privateKey + channel + TimeUtils.dateFormat3(new Date())).toUpperCase();
        this.service_code = service_code;
    }

}
